package com.share.web.action.oa.org;

import javax.annotation.Resource;

import org.apache.struts2.json.annotations.JSON;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.share.bean.oa.org.Employee;
import com.share.service.oa.org.EmployeeManager;

@Controller
@Scope("prototype")
public class LeaveEmployeeAction extends ActionSupport{

	private static final long serialVersionUID = 1L;
	
	private Employee emp ;
	
	@Resource
	private EmployeeManager empMgr ;

	
	private boolean flag = false ;

	
	/** 标示员工离职 */
	public String leaveEmployee() {
		
		System.out.println(emp.getDimissionMsg().getDimissionDate());
		try {
			flag = this.empMgr.updateByParamEmpManager(emp) ;
		} catch (Exception e) {
			e.printStackTrace() ;
		}
		return "leaveJSON" ;
	}
	
	@JSON(serialize=false,deserialize=false)
	public Employee getEmp() {
		return emp;
	}

	public boolean isFlag() {
		return flag;
	}
	public void setEmp(Employee emp) {
		this.emp = emp;
	}
	
	public void setEmpMgr(EmployeeManager empMgr) {
		this.empMgr = empMgr;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}
}
